package com.hnguigu.health.houduan.lcj.mapper_lcj;

import com.hnguigu.health.houduan.lcj.pojo_lcj.TMember_lcj;
import com.hnguigu.health.houduan.lcj.pojo_lcj.TOrder_lcj;
import com.hnguigu.health.pojo.TOrder;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface TOrderMapper_lcj {
    int deleteByPrimaryKey(Integer id);

    int insert(TOrder_lcj record);

    int insertSelective(TOrder_lcj record);

    TOrder_lcj selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TOrder_lcj record);

    int updateByPrimaryKey(TOrder_lcj record);

    List<TOrder_lcj> findAll(String filenumber);
    //确认预约
    int updBymemberId(TOrder_lcj tOrder_lcj);

    //取消预约
    int updBymeid(TOrder_lcj tOrder_lcj);

    @Insert("insert into t_order values(null,#{memberid},#{orderdate},'现场预约','1',#{setmealid},#{ordercreatetime},#{orderupdatetime},0,#{toOrderno})")
    int addtorder(TOrder_lcj tOrder_lcj);

    @Select("select * from t_order where setmeal_id=#{id}")
    List<TOrder_lcj> getBySetId(String id);

    //已预约总人数
    @Select("select count(distinct(member_id)) from t_order where orderDate=#{orderdate} and orderStatus=1")
    Integer getByOrder(String orderdate);
    //判断套餐是否重复
    @Select("select * from t_order where member_id=#{memberid} and orderDate=#{orderdate}")
    List<TOrder_lcj> getBysid(TOrder_lcj tOrder_lcj);

    //获取最后一条
    TOrder_lcj Lastbean();
}